home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Very Best of Atari Inside
/
The Very Best of Atari Inside 1.iso
/
mint
/
mntlib43
/
mntlib
/
unlink.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-09-05
|
628b
|
40 lines
/* unlink.c: by ERS. This routine is in the public domain */
#include <unistd.h>
#include <limits.h>
#include <stdlib.h>
#include <errno.h>
#include <osbind.h>
#include <fcntl.h>
#include "lib.h"
/* remove provided for ansi compatibility */
#ifndef __GNUC__
int remove(filename)
const char *filename;
{
return unlink(filename);
}
#endif
#ifdef __GNUC__
asm(".text; .even; .globl _remove; _remove:"); /* dept of dirty tricks */
#endif
int
unlink(filename)
const char * filename;
{
char name[PATH_MAX];
int r;
_unx2dos(filename, name);
r = (int)Fdelete(name);
if (r < 0) {
errno = -r;
return -1;
}
return 0;
}